
/**
 * @Title: CreditTotalServiceImpl.java
 * @Package com.py.credit.service.impl
 * @Description: TODO
 * Copyright: Copyright (c) 2020
 * Company:金电联行(江苏)信息技术有限公司
 * @author Comsys-jdzc
 * @date 2020年6月16日 下午1:45:18
 * @version V1.0
 */

package com.py.credit.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.py.credit.dao.CreditTotalDao;
import com.py.credit.entity.SysUser;
import com.py.credit.service.CreditTotalService;
import com.py.framework.core.common.Page;

/**
 * @ClassName: CreditTotalServiceImpl
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author jdzc
 * @date 2020年6月16日 下午1:45:18
 *
 */
@Service
public class CreditTotalServiceImpl implements CreditTotalService {
	@Autowired
	private  CreditTotalDao creditTotalDao;

	@Override
	public void addCreditranking(String month, Integer score, String rank, long  deptId) {
		creditTotalDao.addCreditranking(month,score,rank,deptId);

	}

	
	@Override
	public List<Map<String, Object>> getCreditListForPage(String month, Integer score, String rank, Page page) {
		
		return creditTotalDao.getCreditListForPage(month,score,rank,page);
	}



    @Override
    public List<Map<String, Object>> getAnalyseByDeptForPage(String deptName, String startTime, String endTime, SysUser userInfo, Page page) {
        Map<String, Object> params = new HashMap<>(4);
        if(userInfo.getOfficeId()!=0) {
        	   params.put("regionId", userInfo.getAreaId());
               params.put("userType", userInfo.getUserType());
               params.put("deptId", userInfo.getOfficeId());
        }
     

        List<Map<String, Object>> mapList = creditTotalDao.getAnalyseByDeptForPage(deptName, startTime, endTime, params, page);

        return mapList;
    }


    @Override
    public List<Map<String, Object>> getAnalyseDetailByDeptForPage(String areaId,String deptName, String startTime, String endTime, String deptId, Page page) {
        List<Map<String, Object>> mapList = creditTotalDao.getAnalyseDetailByDeptForPage(areaId,deptName, startTime, endTime, deptId, page);

        return mapList;
    }

	@Override
	public List<Map<String, String>> getRankInfo() {
		
		return creditTotalDao.getRankInfo();
	}


	@Override
	public void editCreditranking(String month, Integer score, String rank, String id) {
		creditTotalDao.editCreditranking(month,score,rank,id);
		
	}


	@Override
	public void deleteCreditranking(String id) {
		creditTotalDao.deleteCreditranking(id);
		
	}


	@Override
	public void addMaterial(String batchId, long deptId, String userName, String fileName,String path) {
		creditTotalDao.addMaterial(batchId,deptId,userName,fileName,path);
		
	}


	@Override
	public List<Map<String, Object>> getMaterialsListForPage(String zlmc,Page page) {
		
		return creditTotalDao.getMaterialsListForPage(zlmc,page);
	}


	@Override
	public void updateMaterial(String id, String type, String condition) {
		creditTotalDao.updateMaterial(id,type,condition);
		
	}



  
}
